package com.me.study.app.general

import android.content.Context
import com.luck.picture.lib.basic.PictureSelector
import com.luck.picture.lib.config.SelectMimeType
import com.luck.picture.lib.entity.LocalMedia
import com.luck.picture.lib.interfaces.OnResultCallbackListener

/**
 *create author : FZW
 *create date  : 2024/9/18
 */
object PictureUtil {

    fun openPhoto(
        context: Context,
        call: OnResultCallbackListener<LocalMedia>,
        openGallery: Int = SelectMimeType.ofAll(),
        maxSelectNum: Int = 15,
        isEdit: Boolean = false,
        isEmptyReturn: Boolean = true,) {
        PictureSelector.create(context)
            .openGallery(openGallery)
            .setImageEngine(GlideEngine.createGlideEngine())
            .setMaxSelectNum(maxSelectNum)
            .setMinSelectNum(1)
            .setMaxVideoSelectNum(1)
            .setMinVideoSelectNum(1)
            .isEmptyResultReturn(isEmptyReturn)
            .forResult(call)
    }
}